package com.smartao.base.setting;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.ForeignKey;

import com.smartao.base.module.Module;
import com.smartao.core.orm.entity.BaseEntity;

/**
 * 系统设置项类
 * @author sunxing2008
 *
 */
@Entity
@Table(name = "T_BASE_SETTING")
public class Setting extends BaseEntity<Setting>{
	
	private static final long serialVersionUID = 330252345889098778L;
	
	private String settingKey;
	
	private String settingValue;
	
	private String description;
	
	@ManyToOne
	@ForeignKey(name = "none")
	@JoinColumn(name = "module")
	@Fetch(FetchMode.JOIN)
	private Module module;

	public Setting(){}
	
	public Setting(String settingKey, String settingValue, Module module){
		this.settingKey = settingKey;
		this.settingValue = settingValue;
		this.module = module;
	}
	
	public String getSettingKey() {
		return settingKey;
	}

	public void setSettingKey(String settingKey) {
		this.settingKey = settingKey;
	}

	public String getSettingValue() {
		return settingValue;
	}

	public void setSettingValue(String settingValue) {
		this.settingValue = settingValue;
	}

	public Module getModule() {
		return module;
	}

	public void setModule(Module module) {
		this.module = module;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}
	
}
